﻿{% extends "super.html" %}
{% block title %}员工管理{% endblock %}
{% block s1 %}active{% endblock %}
{% block titlehref %}index{% endblock %}
{% block titlename %}全局动态{% endblock %}
{% block subtitlehref %}{% endblock %}
{% block subtitlename %}员工管理{% endblock %}
{% block content %}
<script type="text/javascript" src="static/myjs/myreply.js"></script>
<section id="main-content">
    <section class="wrapper site-min-height">
        <!-- BEGIN ROW  -->
        <div class="row" id="t1">
            <div class="col-lg-12">
                <section class="panel">
                    <header class="panel-heading">
                        <button class="btn btn-success" disabled>我的留言</button>

                        <button class="btn btn-success pull-right" data-toggle="modal" data-target="#myModal">新留言 </button>
                    </header>
                    <div class="panel-body">
                        <div class="adv-table">
                            <table class="display table table-bordered table-striped" id="example1">
                                <thead>
                                <tr>
                                    <th>内容</th>
                                    <th>人事回复</th>
                                    <th>留言日期</th>
                                    <th>阅读状态</th>
                                </tr>
                                </thead>
                                <tbody>
                                {%for i in list%}
                                <tr>
                                    <td style="width: 35%">{{i.Content}}</td>
                                    <td style="width: 35%">{{i.Reply}}</td>
                                    <td style="width: 15%">{{i.Create_time}}</td>
                                    <td style="width: 10%;text-align: center">
                                        {%if i.Read == 1%}
                                        <span class="label label-default">未读</span>
                                        {%endif%}
                                        {%if i.Read == 2%}
                                        <span class="label label-success">已读</span>
                                        {%endif%}
                                    </td>
                                </tr>
                                {%endfor%}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </section>
            </div>
        </div>

        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
             aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                            &times;
                        </button>
                        <h4 class="modal-title" id="myModalLabel">
                            编辑留言内容
                        </h4>
                    </div>
                    <div class="modal-body">
                        <form id="createrequest" action="reply" method="post">
                            <div class="panel-body">
                                <input id="option" name="option" value="CCC" hidden>
                                <input id="sid" name="sid" value="{{uid}}" hidden>
                                <input id="sname" name="sname" value="{{name}}" hidden>
	                            <input id="state" name="state" value="1" hidden>
	                            <div class="form-group">
                                    <label for="exampleInputPassword1">留言内容</label>
                                    <textarea rows="4" type="text" class="form-control" id="content" name="content"
                                              placeholder="请输入原因详情"></textarea>
                                </div>
                            </div>
                        </form>

                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                        </button>
                        <button id="create" type="button" class="btn btn-primary">
                            提交
                        </button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal -->
        </div>
        <!-- END ROW  -->
    </section>
</section>

<script>
    <!-- DATATABLE JS  -->
    $(document).ready(function () {
        $('#example1').dataTable({
            "aaSorting": [[4, "desc"]]
        });
        $('#example2').dataTable({
            "aaSorting": [[4, "desc"]]
        });
    });
</script>
{% endblock%}